<template>
    <div v-if="userStore.userInfo.Id">
<h2>门店统计列表</h2>
登录名称:{{userStore.userInfo.UserName}}
<table class="table table-bordered">
    <tbody>
        <tr>
            <td>Id</td>
            <td>会员名称</td>
            <td>会员手机</td>
            <td>门店名称</td>
            <td>应支付金额</td>
            <td>实际支付金额</td>
            <td>支付时间</td>
            <td>操作</td>
        </tr>
        <tr v-for="item in data.list" :key="item.Id">
            <td>{{item.Id}}</td>
            <td>{{item.UserName}}</td>
            <td>{{item.Phone.substr(0,3)+"****"+item.Phone.substr(7)}}</td>
            <td>{{item.ShopName}}</td>
            <td>{{item.Money.toFixed(2)}}</td>
            <td>{{item.Pay}}</td>
            <td>{{moment(item.PayTime).format("YYYY-MM-DD HH:mm:ss")}}</td>
            <td>操作</td>
        </tr>
    </tbody>
</table>
    </div>
    <div v-else>您还没有登录
        <input type="button" value="登录" @click="lo">
    </div>
</template>



<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import axios from 'axios';
import moment from 'moment';
import { useUserStore } from '../../stores/user';
const userStore=useUserStore();
const router = useRouter();
const route = useRoute();
onMounted(()=>{
    getList();
})

let a=reactive({
    shopId:''
})
let data:any=reactive({
    list:[]
})

const lo:any=()=>{
    router.push("/")
}

const getList=()=>{
axios({
    url:'/api/Shop/GetShopCountList',
    method:'get',
    params:a
})
.then((res)=>{
    console.log(res);
    data.list=res.data;
})
}
</script>

<style scoped>

</style>